<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="/project/youjiu/Public/Js/Jquery-1.8.2.min.js"></script>
<title>游久</title>
<style type="text/css">
body{margin:0; padding:0; font-family:'微软雅黑'; font-size:13px;} input{font-family:'微软雅黑';} 
ul{list-type:none; margin:0; padding:0;}

.menu{width:200px; background-color:#9CC; position:fixed; top:0px; left:0px;}
.menu ul{padding-top:30px; background-color:#369}
.menu li{padding:10px 0px; background-color:#6C9; color:#FFF; border-bottom:#666 1px solid; text-align:center; cursor:pointer;}
.menu li:hover{background-color:#69C}

.cont{float:left; margin-left:200px;}
.cont .title{padding:5px; border-left:#69F 3px solid; margin:15px;}
.cont button{float:right;}

.textA{width:600px; height:25px; margin:0; padding:0 10px; border:#CCC 1px solid;}
.textA:focus{outline:none; border-color:#6CC;}
.textB{width:150px; height:25px; margin:0; padding:0 10px; border:#CCC 1px solid;}
.textB:focus{outline:none; border-color:#6CC;}

.buttonA{width:80px; height:30px; background-color:#6CC; color:#FFF; border:0; margin-right:20px; cursor:pointer;}
.buttonA:hover{background-color:#6C9;}

a{text-decoration:none; color:#369; cursor:pointer;} a:hover{color:#6CC;}
</style>

<style type="text/css">
.cont table{border:1; border-collapse:collapse; width:80%; text-align:left; margin:20px; border-color:#CCC;}
.cont table th{background-color:#6CC; color:#FFF; padding:10px 10px; font-weight:normal; font-size:12px;}
.cont table td{ padding:5px 10px; font-size:12px; color:#555;}
.cont table tr:nth-child(2n+1){background-color:rgba(200,200,200,0.2);}
</style>

</head>

<body>
<div class="menu">
	<ul>
    	<a href="<?php echo U('Youjiu/Left/index');?>"><li>左部菜单</li></a>
        <a href="<?php echo U('Youjiu/Right/index');?>"><li>右部菜单</li></a>
    </ul>
</div>

<div class="cont">
	
	<div class="title">英雄列表
        <button class="buttonA">导出XML</button>
        <button class="buttonA">增加</button></div>
    
    <hr size="1" align="right" class="cut_solid">
    
    <div class="table_cont">
    	<table border="1">
        	<tr><th>英雄ID</th><th>英雄名称</th><th>操作</th></tr>
        	<?php if(is_array($hero_list)): foreach($hero_list as $key=>$hero): ?><tr><td><?php echo ($hero["hero_id"]); ?></td><td><?php echo ($hero["hero_name"]); ?></td>
                <td><a href="setEquip?hero_id=<?php echo ($hero["hero_id"]); ?>&ops_type=add">增加出装</a>
                	<a href="detailHero?hero_id=<?php echo ($hero["hero_id"]); ?>" target="_blank">HTML展示</a> 
                	<a onClick="deleteHero(<?php echo ($hero["hero_id"]); ?>)">删除</a></td></tr><?php endforeach; endif; ?>
       	</table>
    </div>

</div>

</body>

<script language="javascript">
$("li").eq(0).css("background-color","#69C");
function btnAdd(){ window.open("addHero?ops_type=add", "_self");}
function deleteHero(hero_id){
	var is_del	= confirm("确定删除该条目吗?");
	if(is_del){
		window.open("deleteHero?hero_id="+hero_id, "_self");
	}
}

function outXML(){
	window.open("outXML?hero_id=<?php echo ($hero["hero_id"]); ?>", "_blank");
}
</script>

<script language="javascript">
var screenHeight	= $(window).height();
var screenWidth		= $(window).width();
$(".menu").css("height", screenHeight+'px');
$(".cont").css("width", screenWidth-210+'px');
$(".cut_solid").css("width", screenWidth-210+'px');

$("button").click(function(){
	var btn_html	= $(this).html();
	switch(btn_html){
		case "预览":
			doPreview();
		break;
		
		case "入库":
			doInSql();
		break;
		
		case "增加":
			btnAdd();
		break;
		
		case "导出XML":
			outXML();
		break;
	}
});
</script>
</html>